-
Notifications
You must be signed in to change notification settings - Fork 706
otelhttp: export Event type for WithMessageEvents #8153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hello @dmathieu , OpenTelemetry Go enums usually prefix constants with the type name (e.g. SpanKindServer, SpanKindClient). So shall I change |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8153 +/- ##
=====================================
Coverage 81.8% 81.8%
=====================================
Files 194 194
Lines 13362 13362
=====================================
+ Hits 10936 10937 +1
+ Misses 2029 2027 -2
- Partials 397 398 +1
🚀 New features to boost your workflow:
|
33a327d to
ae43cdd
Compare
|
|
||
| func TestEvent(t *testing.T) { | ||
| if otelhttp.ReadEvents != 1 { | ||
| t.Errorf("ReadEvents = %v, want 1", otelhttp.ReadEvents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we uniformly adopt the assert.Equal method for assertions.
Additionally, we lack tests for unspecifiedEvent.
| t.Errorf("WriteEvents = %v, want 2", otelhttp.WriteEvents) | ||
| } | ||
|
|
||
| if got := otelhttp.WithMessageEvents(otelhttp.ReadEvents); got == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what this verifies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This verifies that the exported ReadEvents and WriteEvents values are valid for WithMessageEvents and return a proper non-nil. Is there any improvement I should make or remove this part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @dmathieu Any good suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subtests would be clearer there.
This PR fixes issue #8132
The WithMessageEvents option previously accepted an unexported type (event).
This change exports the type as Event.